package com.itheima.global;

import com.itheima.common.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice

public class GlobalExceptionHandler {

@ExceptionHandler
    public R exception(Exception e){
    e.printStackTrace();
    return R.error(e.getMessage());
}
}
